package com.mida.dms.knw.entity;


import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
@ApiModel(description = "定义空间")
public class DtDefineSpace implements Serializable {

    @ApiModelProperty(value = "定义空间soid")
    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long defineSpaceSoid;

    @ApiModelProperty(value = "医院soid")
    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long hospitalSoid;

    @ApiModelProperty(value = "检查服务类型")
    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long examServiceType;

    @ApiModelProperty(value = "定义空间名称")
    private String defineSpaceName;

    @ApiModelProperty(value = "拼音码")
    private String pyCode;

    @ApiModelProperty(value = "五笔码")
    private String wbCode;

    @ApiModelProperty(value = "状态")
    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long status;

    @ApiModelProperty(value = "删除标志位")
    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long isDelete;

    @ApiModelProperty(value = "创建日期时间")
    private Date createDate;

    @ApiModelProperty(value = "最后修改日期时间")
    private Date updateDate;

    @ApiModelProperty(value = "最后修改人")
    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long updateUser;

    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long groupSoid;

    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long locationSoid;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof DtDefineSpace)) return false;

        DtDefineSpace that = (DtDefineSpace) o;

        if (getHospitalSoid() != null ? !getHospitalSoid().equals(that.getHospitalSoid()) : that.getHospitalSoid() != null)
            return false;
        if (getExamServiceType() != null ? !getExamServiceType().equals(that.getExamServiceType()) : that.getExamServiceType() != null)
            return false;
        return getDefineSpaceName() != null ? getDefineSpaceName().equals(that.getDefineSpaceName()) : that.getDefineSpaceName() == null;
    }

    @Override
    public int hashCode() {
        int result = getHospitalSoid() != null ? getHospitalSoid().hashCode() : 0;
        result = 31 * result + (getExamServiceType() != null ? getExamServiceType().hashCode() : 0);
        result = 31 * result + (getDefineSpaceName() != null ? getDefineSpaceName().hashCode() : 0);
        return result;
    }
}